/**
 * 
 */
package com.bestbuy.serviceimple;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.bestbuy.dao.ProductDao;
import com.bestbuy.dao.PromotionDAO;
import com.bestbuy.pojo.Promotion;
import com.bestbuy.service.PromotionService;

/**
 * @author ThanhNgo
 *
 */
@Service
public class PromotionServiceImpl implements PromotionService{

	@Autowired
	private PromotionDAO promotionDAO;
	
	/* (non-Javadoc)
	 * @see com.bestbuy.service.PromotionService#getListPromotion(java.lang.String)
	 */
	@Transactional
	public List<Promotion> getListPromotion(String page) {
		// TODO Auto-generated method stub
		return promotionDAO.getListPromotion(page);
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.PromotionService#updatePromotion(com.bestbuy.pojo.Promotion)
	 */
	@Transactional
	public void updatePromotion(Promotion promotion) {
		// TODO Auto-generated method stub
		promotionDAO.updatePromotion(promotion);
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.PromotionService#savePromotion(com.bestbuy.pojo.Promotion)
	 */
	@Transactional
	public void savePromotion(Promotion promotion) {
		// TODO Auto-generated method stub
		promotionDAO.savePromotion(promotion);
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.PromotionService#countProduct()
	 */
	@Transactional
	public int countProduct() {
		// TODO Auto-generated method stub
		return promotionDAO.countProduct();
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.PromotionService#getPromotion(java.lang.String)
	 */
	@Transactional
	public Promotion getPromotion(String idPromotion) {
		// TODO Auto-generated method stub
		return promotionDAO.getPromotion(idPromotion);
	}
	
	@Transactional
	public List<Promotion> getListPromotion() {
		return promotionDAO.getListPromotion();
	}

}
